package com.xja.house.impl;

import com.xja.house.entity.House;
import com.xja.house.mapper.HouseMapper;
import com.xja.house.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("houseService")
public class HouseServiceImpl  implements HouseService {
    @Autowired
    private HouseMapper houseMapper;

    public List<House> findAll() throws Exception {
        return houseMapper.findAll();


    }

    public House selectByPrimaryKey(Integer id) throws Exception {
        return houseMapper.selectByPrimaryKey(id);
    }
    public List<House> selectList() throws Exception {
        return houseMapper.selectList();
    }

    public void deleteById(Integer id) throws Exception {
        houseMapper.deleteByPrimaryKey(id);
    }

    public void add(House house) throws Exception {
        houseMapper.insert(house);
    }
}
